
/*
project/
 ├─lib/
    ├─ x3.js
    ├─ dir1/
        ├─ x3.js
        ├─ dir2/
            ├─ x2.js
            ├─ dir3/
                ├─ editingModule.js
                ├─ x1.js

editingModule.js ==>

before:

var x1 = require('./x1.js');
var x2 = require('../x2.js');
var x3 = require('../../../x3.js');

after:

var arequire = require('arequire'),
    x1 = arequire('dir1/dir2/dir3/x1.js'),
    x2 = arequire('dir1/dir2/x2.js'),
    x3 = arequire('x3.js');

*/

var path = require('path'),
    
    // project root
    root = path.resolve(__dirname, '..', '..'),
    relative = 'lib';

/*
 * localModule - ''
 */
function arequire(localModule){
    return require(path.join(root, relative, localModule));
}

module.exports = arequire;

